﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PPI.Client.Presenter;
using PPI.Client.Utils;
using PPI.Entities;

namespace PPI
{
    public partial class frmSplashVisit : frmBase, ISplashVisit
    {
        private Int32 m_VisitId;
        private SplashVisitPresenter m_Presenter;
        private EVendor_Visit_XMissionStructure m_Visit;
        private bool m_IsDownloadImages;

        public EVendor_Visit_XMissionStructure DownloadedVisit
        {
            get { return m_Visit; }
        }

        public bool IsDownloadImages
        {
            get { return m_IsDownloadImages; }
            set { m_IsDownloadImages = value; }
        }

        public frmSplashVisit()
        {
            InitializeComponent();
            base.MenuMain.Visible = false;
            base.FormSize = FormSizes.Medium;
        }

        public string ActionMessage
        {
            set { lblToTellAction.Text = value; }
        }

        public int ActionProgress
        {
            set { pbAction.Value = value; }
        }

        public int VisitId
        {
            get { return m_VisitId; }
            set { m_VisitId = value; }
        }

        public EVendor_Visit_XMissionStructure Visit
        {
            set
            {
                m_Visit = value;
            }
        }

        public void Finish()
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void frmSplashVisit_Load(object sender, EventArgs e)
        {
            try
            {
                m_Presenter = new SplashVisitPresenter(this);
            }
            catch(Exception ex)
            {
                RegisterError.SaveError(ex);
            }
        }
    }
}
